统计机器学习
Iris分类测试
iris是Fisher使用的数据。这里利用自主开发的几个机器学习软件对iris进行分类。iris数据特征较少,且较为完整,特征如下。
- 1. sepal length in cm
- 2. sepal width in cm
- 3. petal length in cm
- 4. petal width in cm
- 5. class:
-- Iris Setosa
-- Iris Versicolour
- - Iris Virginica
试验时,用一些新的样本进行测试,这些样本来源于原始数据集,但是从训练集中删除。 未对算法优化时,测试了几种计算正确性。
采用QDA方法学习后进行分类结果为
the 1 object predicion class is Irissetosa , the real object is Irissetosa the 2 object predicion class is Irissetosa , the real object is Irissetosa the 3 object predicion class is Irissetosa , the real object is Irissetosa the 4 object predicion class is Irissetosa , the real object is Irissetosa the 5 object predicion class is Irissetosa , the real object is Irissetosa the 6 object predicion class is Irissetosa , the real object is Irissetosa the 7 object predicion class is Irissetosa , the real object is Irissetosa the 8 object predicion class is Irissetosa , the real object is Irissetosa the 9 object predicion class is Irissetosa , the real object is Irissetosa the 10 object predicion class is Irisversicolor , the real object is Irisversicolor the 11 object predicion class is Irisversicolor , the real object is Irisversicolor the 12 object predicion class is Irisversicolor , the real object is Irisversicolor the 13 object predicion class is Irisversicolor , the real object is Irisversicolor the 14 object predicion class is Irisversicolor , the real object is Irisversicolor the 15 object predicion class is Irisversicolor , the real object is Irisversicolor the 16 object predicion class is Irisversicolor , the real object is Irisversicolor the 17 object predicion class is Irisvirginica , the real object is Irisvirginica the 18 object predicion class is Irisvirginica , the real object is Irisvirginica the 19 object predicion class is Irisvirginica , the real object is Irisvirginica the 20 object predicion class is Irisvirginica , the real object is Irisvirginica the 21 object predicion class is Irisvirginica , the real object is Irisvirginica the 22 object predicion class is Irisvirginica , the real object is Irisvirginica the 23 object predicion class is Irisvirginica , the real object is Irisvirginica the 24 object predicion class is Irisvirginica , the real object is Irisvirginica the 25 object predicion class is Irisvirginica , the real object is Irisvirginica the 26 object predicion class is Irisvirginica , the real object is Irisvirginica The prediction accuracy is 1.000000预测准确性为100%.
采用MKNN预测结果为
the 1 object predicion class is Irissetosa , the real object is Irissetosa the 2 object predicion class is Irissetosa , the real object is Irissetosa the 3 object predicion class is Irissetosa , the real object is Irissetosa the 4 object predicion class is Irissetosa , the real object is Irissetosa the 5 object predicion class is Irissetosa , the real object is Irissetosa the 6 object predicion class is Irissetosa , the real object is Irissetosa the 7 object predicion class is Irissetosa , the real object is Irissetosa the 8 object predicion class is Irissetosa , the real object is Irissetosa the 9 object predicion class is Irissetosa , the real object is Irissetosa the 10 object predicion class is Irisversicolor , the real object is Irisversicolor the 11 object predicion class is Irisversicolor , the real object is Irisversicolor the 12 object predicion class is Irisversicolor , the real object is Irisversicolor the 13 object predicion class is Irisversicolor , the real object is Irisversicolor the 14 object predicion class is Irisversicolor , the real object is Irisversicolor the 15 object predicion class is Irisversicolor , the real object is Irisversicolor the 16 object predicion class is Irisversicolor , the real object is Irisversicolor the 17 object predicion class is Irisversicolor , the real object is Irisvirginica the 18 object predicion class is Irisvirginica , the real object is Irisvirginica the 19 object predicion class is Irisvirginica , the real object is Irisvirginica the 20 object predicion class is Irisvirginica , the real object is Irisvirginica the 21 object predicion class is Irisvirginica , the real object is Irisvirginica the 22 object predicion class is Irisvirginica , the real object is Irisvirginica the 23 object predicion class is Irisvirginica , the real object is Irisvirginica the 24 object predicion class is Irisvirginica , the real object is Irisvirginica the 25 object predicion class is Irisvirginica , the real object is Irisvirginica the 26 object predicion class is Irisvirginica , the real object is Irisvirginica The prediction accuracy is 0.961538预测结果准确性为96.15% 另外对其他几中学习方法也进行了测试,见下表
学习算法 | 正确率 |
---|---|
LDA | 76.92 % |
QDA | 100.00% |
NKNN | 96.15% |
NAIVE BAYSE | 92.31% |
BAYSE | 100.00% |
在Iris分类中,完整贝叶斯学习方法取得了100%的准确性。该类测试效果较为理想。而LDA中由于把所有类型的数据用同一个协方差,因此分类准确率较低。 实际应用中,可以针对数据选择性能较好的分类器。